var express = require('express');
var router = express.Router();
var db = require('../config/db')


router.get('/list', (req, res) =>{
  let {pageNum,pageSize} = req.query
  let sql = "select * from fupin limit " 
  + (pageNum-1)*pageSize+","+pageSize+""  
  db.query(sql).then(value =>{
    res.send(value)
  }) 
});

// 添加信息
router.post('/add',(req,res) =>{
  let {biaoti,addtime,fengmian,neirong} = req.body
  console.log(biaoti,addtime,fengmian,neirong);
  res.send()
})

// 添加用户信息
router.post('/adduser',(req,res) =>{
  console.log(req.body);
  res.send();
})

// 更改用户信息
router.post('/userupdate',(req,res) =>{
  console.log(req.body);
  res.send();
})

// 删除用户信息
router.post('/deluser',(req,res) =>{
  console.log(req.body);
  res.send();
})

// 搜索
router.get('/search',(req,res) =>{
  console.log(req.query);
  res.send();
})

module.exports = router;
